Trigonometric funtions from "Stork"

Charlie Veniot22nd June 2022 at 4:51pm
' BASIC Anywhere Machine program by Charlie Veniot
' Trigonometric functions by Hamid Naderi Yeganeh for "Stork" at https://www.huffpost.com/entry/mathematical-birds_b_8876904

dim k, a, b, r as double

pi = 3.1415929
screen _newimage(9000, 5750, 21)

k1 = -4000
k2 = 4000
couleur = &hff0000
s = 1
for r = 46 to 49 step 1
gosub a_run
sleep 0.0125
next r
end

a_run:
for k = k1 to k2 step s
a = int( ( (3*k/4000)+(cos(32*pi*k/4000))^6*sin((k/4000)^7*(pi/2)) )*1000 )
b = int( ( (-1)*(cos(32*pi*k/4000))^6*cos((k/4000)^7*(pi/2))*(1+(cos(pi*k/8000)*cos(3*pi*k/8000))^4)+(3)*(cos(pi*k/8000)*cos(3*pi*k/8000))^16 *(cos(16*pi*k/4000))^9 )*1000)
circle (4500-a,2000-b), r, couleur
next k
return